package com.hcg.initproject.controllersame;

import com.hcg.initproject.domain.bean.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 加入 @ComponentScan注解后 提供扫包范围，只要在同一个包下的类启动均可访问成功
 */
@RestController
@Slf4j
public class Initproject04 {

    public static void main(String[] args) {
        SpringApplication.run(Initproject04.class, args);
    }

    @RequestMapping("/initp")
    public String init(String n){
        User user = new User();
        if(n.equals("n")){
            log.info("输入的参数是：{}",n);
            return "I love you";
        }
        return "init project";
    }

}

